package thelperinator

import org.hibernate.SessionFactory




import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.scribe.builder.ServiceBuilder;
import org.scribe.model.OAuthRequest;
import org.scribe.model.Response;
import org.scribe.model.Token;
import org.scribe.model.Verb;
import org.scribe.oauth.OAuthService;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;


import thelperinator.YelpAPI.*;


class knowledge {
    private static SessionFactory factory;

    private static final String CONSUMER_KEY = "X6vW_6VSX2FzT-oy1AZ_Tw";
    private static final String CONSUMER_SECRET = "m6W3ScxTQFjuFZBX3LZC0HKYZfg";
    private static final String TOKEN = "dMdXmachaPzGWoFUHP2gZ2U7O-osRlDu";
    private static final String TOKEN_SECRET = "_JnQSHCHVQq0x5JjR500ykEwsCQ";


  static void main(def args) {



    //    YelpAPICLI yelpApiCli = new YelpAPICLI();
      //    new JCommander(yelpApiCli, args);


      YelpAPI.YelpAPICLI yelpApiCli= new YelpAPI();
      new JCommander(yelpApiCli, args);
    YelpAPI yelpApi = new YelpAPI(CONSUMER_KEY, CONSUMER_SECRET, TOKEN, TOKEN_SECRET);
    queryAPI(yelpApi, yelpApiCli);



    //        def date = new dateandtime()
	//    println date.test()


        //def map = new maps("100+spear+street+san+francisco, ca", "+1+Ferry+building,+San+Francisco,+CA+94111")
        //map.test()



        /*

        GeocodingResult[] results =  GeocodingApi.geocode(context,
                "1600 Amphitheatre Parkway Mountain View, CA 94043").await();
        System.out.println(results[0].formattedAddress);
        */



      /*
        def datentime = new dateandtime()
        datentime.test()

        String test = "col1\tcol2"
        println test
        test = test.replaceAll("\t", "[|]")
        println test
        test = test.replaceAll("[|]", ",")
        println test
        println "hello"

      */



/*
        def dt = new dateandtime()
        dt.test()

        OwnerService owns = new OwnerService()
        Owner own = new Owner()
        own.Fname = "ryan"
        own.Lname = "p"
        owns.createOwner(own)*/

//        def hibkn = new hibernateknowledge()
//        hibkn.setUp()



	    }
}
